<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/11/17
  Time: 11:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>添加用户</title>
    <style>
        body{
            background: url(image/1.jpg);
            margin-top: 100px;
        }
        #div1{
            text-align: center;
            size: 14px;
            border: 2px solid palevioletred;
            margin-left: 10px;
            margin-right: 10px;
            margin :auto;
            width: 50%;
            height: 50%;
            background: lightblue;
        }
        #form1{
            margin: auto;
        }
    </style>
    <script type="text/javascript">
        function addUser(){
            var form = document.forms[0];
            form.action = "<%=basePath%>user/addUser";
            form.method="post";
            form.submit();
        }
    </script>

</head>

<body>
<div id="div1">
<h3>添加用户</h3>
<form action="" name="userForm" id="form1">

    姓名：<input type="text" name="userName" id="userName"><br>
    年龄：<input type="text" name="age" id="age"><br>
    性别：<select name="sex" id="sex" checked="checked">
          <option value="男">男</option>
            <option value="女">女</option>
        </select>
    <br>
    职业：<input type="text" id="job" name="job"><br>
    学校：<textarea name = "school" id="school" cols="25" rows="1"></textarea><br>
    爱好：<input type="text" name="hobby" id="hobby"><br>

    <input type="button" value="添加" onclick="addUser()">
</form>
</div>
</body>
</html>

